<%@page contentType="text/html; charset=utf-8" language="java" import="cn.ac.cintcm.synonymous.*"  errorPage="" %>
<%@page import="java.util.List, java.util.ArrayList" %>

<% 
	String dataPath = Config.getDataDir();
	UpLoadBean bean = new UpLoadBean(dataPath);
	String fileName = "";
	try{
		bean.UpLoad(request);
		fileName = bean.getFileName();
	}catch(Exception e){
	} 
	List metaData = new ArrayList();
	Message msg = CSVDataSource.readMetaData (fileName, metaData);
	CSVDataSource.writeData(fileName, CSVDataSource.importData(fileName));
%>
<html>
<head>
  <meta content="text/html; charset=utf-8" http-equiv="content-type">
  <title>正异名修正_参数配置</title>
</head>
<body >
	<center>
<%=msg==null?"":msg.toString()%>
<% if (metaData.size() > 1) { %>
		<form action="config.jsp"  method="post">
			<table>
			<tr>
				<td bgcolor="lightblue" align="left"><b>关键字字段: </b></td>
				<td bgcolor="silver" >
					<%for (int i =0; i < metaData.size(); i++) { %>
						<input type="radio" name="id" value="<%=metaData.get(i)%>"><%=metaData.get(i)%>
					<%}%>
				</td>
			</tr>
			<tr>
				<td bgcolor="lightblue" align="left"><b>同异名字段: </b></td>
				<td bgcolor="silver" >  
					<%for (int i =0; i < metaData.size(); i++) { %>
						<input type="radio" name="synonymous" value="<%=metaData.get(i)%>"><%=metaData.get(i)%>
					<%}%>
				</td>
			</tr>
			<tr>
				<td bgcolor="lightblue" align="left"><b>主要显示字段 : </b></td>
				<td bgcolor="silver" >
					<%for (int i =0; i < metaData.size(); i++) { %>
						<input type="radio" name="primary" value="<%=metaData.get(i)%>"><%=metaData.get(i)%>
					<%}%>
				</td>
			</tr>

			<tr>
				<td bgcolor="lightblue" align="left"><b>辅助显示字段 : </b></td>
				<td bgcolor="silver" >
					<%for (int i =0; i < metaData.size(); i++) { %>
						<input type="checkbox" name="display" value="<%=metaData.get(i)%>"><%=metaData.get(i)%>
					<%}%>
				</td>
			</tr>
			<input type="hidden" name="fileName" value="<%=fileName%>">
			<tr>
				<td colspan="2" bgcolor="silver" align="center"><input type="submit" name="submit" value="配置"/>&nbsp;<a href="index.jsp">取消配置</a></td>
			</tr>
			</table>
		</form>	
<%}%>
	</center>
</body>
</html>
